﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace BYManageInfoSystem
{
    public partial class Frm_ContracNoView : Form
    {
        private List<string> m_lstContractTemp = new List<string>();
        public  List<string> m_lstContractRemove = new List<string>();

        public Frm_ContracNoView(List<string> lstContractTemp)
        {
            InitializeComponent();
            foreach (string strTemp in lstContractTemp)
            {
                m_lstContractTemp.Add(strTemp);

            }
        }

        public Frm_ContracNoView()
        {
            InitializeComponent();
        }
        private void Frm_ContracNoView_Load(object sender, EventArgs e)
        {
            foreach (string strTemp in m_lstContractTemp)
            {
                this.listBoxAllContract.Items.Add(strTemp);

            }
        }

        private void buttonGoOne_Click(object sender, EventArgs e)
        {
            List<string> lstContractTemp = new List<string>();
            m_lstContractRemove.Clear();
            if (this.listBoxAllContract.SelectedItems.Count >= 0)
            {
                foreach (object o in this.listBoxAllContract.SelectedItems)
                {
                    string strTemp = (string)o;
                    lstContractTemp.Add(strTemp);

                }
                foreach (string o in lstContractTemp)
                {

                    this.listBoxAllContract.Items.Remove(o);
                    m_lstContractTemp.Remove(o);
                    m_lstContractRemove.Add(o);
                }
            }
        }

        private void buttonOk_Click(object sender, EventArgs e)
        {
            this.DialogResult = DialogResult.OK; 
        }
    }
}
